package com.zhiche.lisa.bms.service.pay.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zhiche.lisa.bms.dao.mapper.pay.PayApplyDtlFundMapper;
import com.zhiche.lisa.bms.dao.model.pay.PayApplyDtlFund;
import com.zhiche.lisa.bms.service.pay.PayApplyDtlFundService;
import com.zhiche.lisa.core.supports.BaseException;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**
 * <p>
 * 支付申请明细表-其他扣款 服务实现类
 * </p>
 *
 * @author hongbo
 * @since 2018-09-27
 */
@Service
public class PayApplyDtlFundServiceImpl extends ServiceImpl<PayApplyDtlFundMapper, PayApplyDtlFund> implements PayApplyDtlFundService {
    @Override
    public List<PayApplyDtlFund> queryPayApplyDtlFundList(Long payId) {
        if (ObjectUtils.isEmpty(payId)) throw new BaseException("支付申请ID,不能为空！");
        EntityWrapper ew = new EntityWrapper<>();
        ew.eq("head_id", payId);
        return this.selectList(ew);
    }

    @Override
    public void deletePayApplyDtlFundList(Long payId) {
        EntityWrapper ew = new EntityWrapper<>();
        ew.eq("head_id", payId);
        this.delete(ew);
    }
}
